package com.luxsoft.sw3.ui;

import java.util.List;

import javax.swing.JMenu;
import javax.swing.JMenuBar;

import org.apache.log4j.Logger;

import com.jgoodies.uif.builder.MenuBuilder;
import com.luxsoft.siipap.swing.actions.ShowViewAction;
import com.luxsoft.siipap.swing.impl.MenuFactoryImpl;
import com.luxsoft.siipap.swing.views.ViewActionCreator;

public class EM2MenuFactory extends MenuFactoryImpl{
	
	@SuppressWarnings("unused")
	private Logger logger=Logger.getLogger(getClass());
	
	protected void buildCustomMenus(List<JMenu> customMenus){		
		
		customMenus.add(buildReplicacion());
		customMenus.add(buildConsultas());
	}
	
	protected JMenuBar buildMenuBar(){
		JMenuBar bar=super.buildMenuBar();		
		return bar;
	}	
	
	
	protected JMenu buildReplicacion(){
		MenuBuilder builder=new MenuBuilder("Servicios",'S');
		ShowViewAction showReplicadoresView=new ShowViewAction();
		showReplicadoresView.setViewId("replicacionView");
		getActionManager().configure(showReplicadoresView, "mostrarReplicadoresView");
		builder.add(showReplicadoresView);
		//builder.add(getActionManager().getAction(EM2Roles.REPLICA_ADMIN.name()));
		
		return builder.getMenu();
	}
	
	protected JMenu buildConsultas(){
		MenuBuilder builder=new MenuBuilder("Consultas",'C');
		return builder.getMenu();
	}
	
	
}
